import sequelize from '../config/sequelize';
import Sequelize from 'sequelize';
const TodosModel: any = sequelize.define(
  'Todos',
  {
    //   id
    id: {
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER,
    },
    // 内容
    todoContent: {
      type: Sequelize.STRING(50),
      allowNull: false,
    },
    // 创建时间
    createTime: {
      type: Sequelize.DATE,
      defaultValue: Sequelize.NOW,
    },
    // 是否完成
    isFinish: {
      type: Sequelize.BOOLEAN,
      defaultValue: false,
    },
  },
  {
    tableName: 'Todos',
  },
);
export default TodosModel;
